package com.jsbs.iam.auth.mapper;

import com.jsbs.iam.auth.dto.IamMenuManagerAlreadySelectDto;
import com.jsbs.iam.auth.dto.IamStaticUserGroupUsersPermissionEditingDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface IamUserGroupMenuRelationMapper {

    /**
     * 功能描述：根据用户组获取菜单列表
     * @param applyCode
     * @param userGroupCodeList
     * @return
     */
    List<String> queryByUserCode(@Param("applyCode") String applyCode, @Param("userGroupCodeList") List<String> userGroupCodeList);

    /**
     * 功能描述：用户组权限编辑时，插入数据至菜单表中
     * @param iamStaticUserGroupUsersPermissionEditingDto
     * @return
     */
    int insertUserGroupMenuRelation(@Param("iamStaticUserGroupUsersPermissionEditingDto") IamStaticUserGroupUsersPermissionEditingDto iamStaticUserGroupUsersPermissionEditingDto);

    /**
     * 功能描述：用户组下每次编辑菜单树后保存时，都会删除该用户组下该应用下的旧数据
     * @param iamStaticUserGroupUsersPermissionEditingDto
     * @return
     */
    int deleteUserGroupMenuRelation(@Param("iamStaticUserGroupUsersPermissionEditingDto") IamStaticUserGroupUsersPermissionEditingDto iamStaticUserGroupUsersPermissionEditingDto);

    /**
     * 功能描述：该用户组的该应用下，是否有数据？
     * @param iamStaticUserGroupUsersPermissionEditingDto
     * @return
     */
    int countUserGroupMenuRelation(@Param("iamStaticUserGroupUsersPermissionEditingDto") IamStaticUserGroupUsersPermissionEditingDto iamStaticUserGroupUsersPermissionEditingDto);

    /**
     * 功能描述：查询该用户组所有勾选的菜单
     * @param iamMenuManagerAlreadySelectDto
     * @return List
     */
    List<String> querySelectMenu(@Param("iamMenuManagerAlreadySelectDto") IamMenuManagerAlreadySelectDto iamMenuManagerAlreadySelectDto);
}